import fetch from "@/api";

/**
 * 账号登录
 * @RequestParam String mobile 手机号
 * @RequestParam String password 密码
 */
function dataMiddleGroundBaseUserLogin(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/login",
    data: params,
  });
}
/**
 * 短信登录
 * @RequestParam String mobile 手机号
 * @RequestParam String password 验证码
 */
function dataMiddleGroundBaseUserLoginBySms(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/loginBySms",
    data: params,
  });
}
/**
 * 注册
 * @RequestParam String mobile 手机号
 * @RequestParam String password 密码
 */
function dataMiddleGroundBaseUserRegisterUser(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/registerUser",
    data: params,
  });
}
/**
 * 用户列表
 * @RequestParam String userName 用户名
 * @RequestParam String pageNum 当前页
 * @RequestParam String pageSize 条数
 * @RequestParam String status 审批or管理
 */
function dataMiddleGroundBaseUserPage(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/userPage",
    data: params,
  });
}
/**
 * 新增用户
 * @RequestParam String userName 用户名
 * @RequestParam String pageNum 当前页
 * @RequestParam String pageSize 条数
 * @RequestParam String status 审批or管理
 */
function dataMiddleGroundBaseUserAddUser(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/addUser",
    data: params,
    message: true,
  });
}
/**
 * 删除用户
 * @RequestParam Array idList 用户id集合
 */
function dataMiddleGroundBaseUserDelUsers(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/delUsers",
    data: params,
    openResponese: true,
    message: true,
  });
}
/**
 * 用户审批
 * @RequestParam String status 状态  通过 0  拒绝 3
 * @RequestParam String userId 用户id
 */
function dataMiddleGroundBaseUserUpdateUser(params: object): Promise<any> {
  return fetch({
    method: "POST",
    url: "data-middleground-base/base/user/updateUser",
    data: params,
  });
}
export {
  dataMiddleGroundBaseUserLogin,
  dataMiddleGroundBaseUserLoginBySms,
  dataMiddleGroundBaseUserRegisterUser,
  dataMiddleGroundBaseUserPage,
  dataMiddleGroundBaseUserAddUser,
  dataMiddleGroundBaseUserDelUsers,
  dataMiddleGroundBaseUserUpdateUser,
};
